package com.paifori.cloud.security.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.paifori.cloud.security.bean.Config;
import com.paifori.cloud.security.common.Result;
import com.paifori.cloud.security.mapper.ConfigMapper;

@RestController
public class IndexController {

    @Autowired
    private ConfigMapper configMapper;

    @GetMapping("/index")
    public String index() {
	return String.valueOf(System.currentTimeMillis());
    }

    @GetMapping("/config")
    public Result config() {
	return Result.success(configMapper.selectList(new QueryWrapper<Config>()), "success!");
    }

}
